﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GameSchool.Extra;
using System.ComponentModel.DataAnnotations;

namespace GameSchool.Models
{
    [Table("gs_assignment_question")]
	public class AssignmentQuestion
    {
        public AssignmentQuestion() 
        {
            this.AnswerOptions = new List<AnswerOption>();
        }
        
		[Key]
        [Column("question_id")]
        public int QuestionId { get; set; }

        [Column("assignment_id")]
        public int AssignmentId { get; set; }

        [ForeignKey("AssignmentId")]
        public virtual Assignment Assignment { get; set; }

        [Column("title")]
		[Display(Name = "Titill")]
		[Required(ErrorMessage="Vinsamlegast settu inn titil")]
        public string Title { get; set; }

        [Column("question_type")]
        public CustomTypes.QuestionType QuestionType { get; set; } 

		[Column("active")]
        public bool Active { get; set; }

        public virtual ICollection<AnswerOption> AnswerOptions { get; set; } // Háð QuestionType..
    }
}